package com.wjw.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.wjw.bean.User;

public interface UserDao {
	@Select("select * from t_user where loginacct=#{0} and userpwd=#{1}")
	public User find4login(String loginacct,String userpwd);
	
	@Select("select * from t_user")
	public List<User> findAll();
	
	public List<User> pagefind(Map<String,Object> mp);
	
	public int findPageNum(Map<String,Object> mp);
	
	public void insertUser(User user);
	
	@Select("select * from t_user where id=#{id}")
	public User findById(Integer id);
	
	public void updateUser(User user);
	
	public void deleteUser(Integer id);
	
	public void deleteUsers(Map<String, Object> map);
	
	public void insertUserRoles(Map<String,Object> map);
	
	public void deleteUserRoles(Map<String,Object> map);
	
	@Select("select roleid from t_user_role where userid=#{userid}")
	public List<Integer> findRoleByUser(Integer id);
}
